import request from '@/utils/request'
//注册
export const userRegister = ({ username, password, repassword }) =>
  request.post('/api/reg', { username, password, repassword })
//登录
export const userLogin = ({ username, password }) =>
  request.post('/api/login', { username, password })
// 获取用户信息
export const getUserInfo = () => request.get('/my/userinfo')
//更新用户信息
export const userEdit = (data) => request.put('/my/userinfo', data)
//更新用户头像
export const userAvatar = (avatar) =>
  request.patch('/my/update/avatar', { avatar })
//更新用户密码
export const userPwd = (data) => request.patch('/my/updatepwd', data)
